package com.woniu108.order.client;

import com.woniu108.carService.commos.dto.AddressInfoDto;
import com.woniu108.carService.commos.dto.OrderStreamDto;
import com.woniu108.carService.commos.model.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author LY
 */
@FeignClient(name = "extra-server",path = "/extra")
public interface ExtraClient {
    /**
     * 查询地址信息
     * @param addressId 地址id
     * @return 地址信息
     */
    @GetMapping("/addressInfo/getByAddressId/{addressId}.c")
    Result<AddressInfoDto> AddressInfoById(@PathVariable("addressId") Integer addressId);

    /**
     * 生成用户订单流程信息
     * @param orderServiceNum 服务订单编号
     * @param userId 用户编号
     * @param storeId 门店编号
     * @param streamId 服务流程Id
     * @return result 是否正常访问接口结果
     */
    @GetMapping("/orderStream/addOrderStream.api")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderServiceNum",value = "服务订单编号"),
            @ApiImplicitParam(name = "userId",value = "用户编号"),
            @ApiImplicitParam(name = "storeId",value = "门店编号"),
            @ApiImplicitParam(name = "streamId",value = "服务流程Id")
    })
    @ApiOperation("生成用户订单流程信息")
    public Result addOrderStream(@RequestParam("orderServiceNum") String orderServiceNum,@RequestParam("userId")String userId,@RequestParam("orderServiceNum")Integer storeId,@RequestParam("streamId")Integer streamId,@RequestParam("serviceId")Integer serviceId);

    /**
     * 获取单个订单的订单流程详细信息
     * @param orderServiceNum 服务订单编号
     * @return List<OrderStreamDto> 指定的订单流程详细信息列表
     */
    @GetMapping("/orderStream/getOrderStreamByNum/{orderServiceNum}.c")
    Result<List<OrderStreamDto>> getOrderStreamByNum(@PathVariable("orderServiceNum")@RequestParam("orderServiceNum") String orderServiceNum);


}
